﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace SlamDunk.CMS.Model.ViewModel
{
    /// <summary>
    /// User视图模型类（登录用）
    /// </summary>
    public class UserViewForLogin
    {
        #region 01.属性——用户名
        /// <summary>
        /// 属性——UserName
        /// </summary>
        [DisplayName("用户名")]
        [Required(ErrorMessage = "必填")]
        [StringLength(16, ErrorMessage = "用户名过长")]
        public string UserName { get; set; }
        #endregion

        #region 02.属性——密码
        /// <summary>
        /// 属性——Password
        /// </summary>
        [DisplayName("密码")]
        [Required(ErrorMessage = "必填")]
        [StringLength(32, ErrorMessage = "密码过长")]
        public string Password { get; set; }
        #endregion

        #region 03.属性——记住密码
        /// <summary>
        /// 属性——记住密码
        /// </summary>
        [DisplayName("记住密码")]
        public bool IsRemember { get; set; }
        #endregion

        #region 04.属性——验证码
        /// <summary>
        /// 属性——验证码
        /// </summary>
        [Required(ErrorMessage = "必填")]
        [RegularExpression(@"\d{4}", ErrorMessage = "格式不正确")]
        [StringLength(4, ErrorMessage = "验证码过长")]
        [DisplayName("验证码")]
        public string ValidCode { get; set; }
        #endregion
    }
}
